package club.caihappy.controller;

import club.caihappy.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by DELL on 2021/10/20
 **/
@Controller
public class HelloController {

    @Autowired
    private HelloService helloService;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        String s = helloService.sayHello("tomcat...");
        return s;
    }

    //WEB-INF/views/success.jsp
    @RequestMapping("/suc")
    public String success(){
        return "success";
    }

}
